home *** CD-ROM | disk | FTP | other *** search
/ Inter.Net 55-1 / Inter.Net 55-1.iso / beos / PPBeDevKit.ZIP / PLAYERPR.TAR / PlayerPRO / Source / Import-Export / MADH.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-12-26  |  3.8 KB  |  160 lines

  1. /********************                        ***********************/
  2. //
  3. //    Player PRO 5.0 - DRIVER SOURCE CODE -
  4. //
  5. //    Library Version 5.0
  6. //
  7. //    To use with MAD Library for Mac: Symantec, CodeWarrior and MPW
  8. //
  9. //    Antoine ROSSET
  10. //    16 Tranchees
  11. //    1206 GENEVA
  12. //    SWITZERLAND
  13. //
  14. //    COPYRIGHT ANTOINE ROSSET 1996, 1997, 1998
  15. //
  16. //    Thank you for your interest in PlayerPRO !
  17. //
  18. //    FAX:                (+41 22) 346 11 97
  19. //    PHONE:             (+41 79) 203 74 62
  20. //    Internet:     RossetAntoine@bluewin.ch
  21. //
  22. /********************                        ***********************/
  23.  
  24. #ifndef __MADH__
  25. #define __MADH__
  26.  
  27. #if defined(powerc) || defined (__powerc)
  28. #pragma options align=mac68k
  29. #else
  30. #if !defined(THINK_C)
  31. #pragma options align=mac68k
  32. #endif
  33. #endif
  34.  
  35. // ***    
  36. // ***    PATTERN DESCRIPTION
  37. // ***    
  38.  
  39. struct oldCmd                            // COMMAND
  40. {
  41.     Byte    ins;                        // Instrument no        0x00: no ins cmd
  42.     Byte     note;                    // Note, see table        0xFF : no note cmd
  43.     Byte     cmd;                    // Effect cmd
  44.     Byte     arg;                    // Effect argument
  45.     Byte    vol;                    // Volume                0xFF : no volume cmd
  46.     Byte    unused;
  47. };
  48. typedef struct oldCmd oldCmd;
  49.  
  50. struct oldPatHeader                    // HEADER
  51. {
  52.     long    size;                    // Length of pattern: standard = 64
  53.     long    compMode;                // Compression mode, none = 'NONE'
  54.     char    name[ 32];
  55.     long    patBytes;                // Pattern Size in Bytes
  56.     long    unused2;
  57. };
  58. typedef struct oldPatHeader oldPatHeader;
  59.  
  60. struct oldPatData                        // DATA STRUCTURE : HEADER + COMMANDS
  61. {                                    // Pattern = 64 notes to play
  62.     oldPatHeader    header;
  63.     oldCmd            Cmds[];
  64. };
  65. typedef struct oldPatData oldPatData;
  66.  
  67.  
  68.  
  69. // ***    
  70. // ***    INSTRUMENT DESCRIPTION
  71. // ***    
  72.  
  73.  
  74. struct oldsData                                // SAMPLE
  75. {
  76.     long                 size;                // Sample length
  77.     long                loopBeg;            // LoopStart
  78.     long                loopSize;            // LoopLength
  79.     Byte                 vol;                // Base volume
  80.     unsigned short        c2spd;                // c2spd
  81.     Byte                loopType;
  82.     Byte                amp;                // 8 or 16 bits
  83.     Byte                panning;
  84.     char                relNote;
  85.     char                 name[ 32];            // Sample name
  86.     Ptr                    data;                // Used only in memory, not in files
  87. };
  88. typedef struct oldsData oldsData;
  89.  
  90. struct oldEnvRec                // Volume Enveloppe
  91. {
  92.     short     pos;                // pos
  93.     short    val;                // val
  94. };
  95. typedef struct oldEnvRec oldEnvRec;
  96.  
  97. struct oldInstrData                // INSTRUMENT
  98. {
  99.     char     name[ 32];            // instrument name
  100.     Byte     type;                // Instrument type = 0
  101.  
  102.     short    numSamples;        // Number of samples in instrument
  103.  
  104.     /**/
  105.  
  106.     Byte        what[ 96];        // Sample number for all notes
  107.     oldEnvRec         volEnv[ 12];    // Points for volume envelope
  108.     oldEnvRec        pannEnv[ 12];    // Points for panning envelope
  109.     
  110.     Byte    volSize;            // Number of volume points
  111.     Byte    pannSize;            // Number of panning points
  112.     
  113.     Byte    volSus;                // Volume sustain point
  114.     Byte    volBeg;                // Volume loop start point
  115.     Byte    volEnd;                // Volume loop end point
  116.     
  117.     Byte    pannSus;            // Panning sustain point
  118.     Byte    pannBeg;            // Panning loop start point
  119.     Byte    pannEnd;            // Panning loop end point
  120.  
  121.     Byte    volType;            // Volume type: bit 0: On; 1: Sustain; 2: Loop
  122.     Byte    pannType;            // Panning type: bit 0: On; 1: Sustain; 2: Loop
  123.     
  124.     unsigned short    volFade;    // Volume fadeout
  125.     
  126.     Byte    vibDepth;
  127.     Byte    vibRate;
  128. };
  129. typedef struct oldInstrData oldInstrData;
  130.  
  131.  
  132.  
  133. // ***    
  134. // ***    MAD FILE HEADER DESCRIPTION
  135. // ***    
  136.  
  137.  
  138. struct oldMADSpec
  139. {
  140.     long        MAD;                        // Mad Identification: MADG in version 2.0
  141.     char         name[ 32];                    // Music's name
  142.     char        infos[ 256];                // Informations & Author name of the music
  143.     Byte        numPat;                    // Patterns number
  144.     Byte        numChn;                    // Channels number
  145.     Byte         numPointers;                // Partition length
  146.     Byte        oPointers[ 256];            // Partition : Patterns ID List
  147.     short        speed;                        // Default speed
  148.     short        tempo;                        // Default tempo
  149.     oldInstrData     fid[ 64];                    // Instruments description
  150. };
  151. typedef struct oldMADSpec oldMADSpec;
  152.  
  153. #if defined(powerc) || defined (__powerc)
  154. #pragma options align=reset
  155. #else
  156. #if !defined(THINK_C)
  157. #pragma options align=reset
  158. #endif
  159. #endif
  160. #endif